﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;

namespace olierFrm.MVC
{
    public class ModuleRoleFilter : ActionFilterAttribute
    {
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            string moduleID = filterContext.RouteData.Values["CustController"] + "/" + filterContext.RouteData.Values["Module"];
            UserRole ur = new UserRole(moduleID, "^_^");
            if (!ur.HavePower)
            {
                //return new StatusResult(404, "dd");
                throw new System.Web.HttpException(404, "无法找到资源。");
            }
            base.OnActionExecuting(filterContext);
        }
    }
}
